import redis
if __name__ == '__main__':
    try:
        re=redis.Redis(host='192.168.0.158',
                    port=6379,
                    db=0)
        keys=re.keys('*')
        print(keys)
    except Exception as e:
        print(e)
    finally:
        re.close()